﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ClientAppViaWebService.DBAdministration
{
    public partial class DivisionsAdministrationForm : Form
    {
        private string databaseName;
        public DivisionsAdministrationForm(string _databaseName)
        {
            InitializeComponent();
            databaseName = _databaseName;
            foreach (Panel p in this.Controls)
            {
                p.Cursor = Cursors.Hand;
                p.MouseHover += new EventHandler(p_MouseHover);
                p.MouseLeave += new EventHandler(p_MouseLeave);
            }
        }

        void p_MouseLeave(object sender, EventArgs e)
        {
            (sender as Panel).BorderStyle = BorderStyle.None;
        }

        void p_MouseHover(object sender, EventArgs e)
        {
            (sender as Panel).BorderStyle = BorderStyle.Fixed3D;
        }      

        private void pnlTObject_DoubleClick(object sender, EventArgs e)
        {
            TableAdministrationForm f = new TableAdministrationForm(databaseName, "TObjects");
            f.ShowDialog(this);
        }

        private void pnlDivision_DoubleClick(object sender, EventArgs e)
        {
            TableAdministrationForm f = new TableAdministrationForm(databaseName, "Divisions");
            f.ShowDialog(this); 
        }

        private void pnlServiceDivision_DoubleClick(object sender, EventArgs e)
        {
            TableAdministrationForm f = new TableAdministrationForm(databaseName, "ServiceDivisions");
            f.ShowDialog(this);
        }

        private void pnlManDiv_DoubleClick(object sender, EventArgs e)
        {
            TableAdministrationForm f = new TableAdministrationForm(databaseName, "ManagingDivisions");
            f.ShowDialog(this);
        }

        private void pnlClub_DoubleClick(object sender, EventArgs e)
        {
            TableAdministrationForm f = new TableAdministrationForm(databaseName, "Clubs");
            f.ShowDialog(this);
        }

        private void pnlSection_DoubleClick(object sender, EventArgs e)
        {
            TableAdministrationForm f = new TableAdministrationForm(databaseName, "Sections");
            f.ShowDialog(this);
        }

        private void pnlRestDiv_DoubleClick(object sender, EventArgs e)
        {
            TableAdministrationForm f = new TableAdministrationForm(databaseName, "RestDivisions");
            f.ShowDialog(this);
        }

        private void pnlOrgDiv_DoubleClick(object sender, EventArgs e)
        {
            TableAdministrationForm f = new TableAdministrationForm(databaseName, "OrgDivisions");
            f.ShowDialog(this);
        }

        private void pnlResearchDiv_DoubleClick(object sender, EventArgs e)
        {
            TableAdministrationForm f = new TableAdministrationForm(databaseName, "ResearchDivisions");
            f.ShowDialog(this);
        }

        private void pnlLaboratory_DoubleClick(object sender, EventArgs e)
        {
            TableAdministrationForm f = new TableAdministrationForm(databaseName, "Laboratories");
            f.ShowDialog(this);
        }

        private void pnlStream_DoubleClick(object sender, EventArgs e)
        {
            TableAdministrationForm f = new TableAdministrationForm(databaseName, "Streams");
            f.ShowDialog(this);
        }

        private void pnlGroup_DoubleClick(object sender, EventArgs e)
        {
            TableAdministrationForm f = new TableAdministrationForm(databaseName, "Groups");
            f.ShowDialog(this);
        }

        private void pnlDepartment_DoubleClick(object sender, EventArgs e)
        {
            TableAdministrationForm f = new TableAdministrationForm(databaseName, "Departments");
            f.ShowDialog(this);
        }

        private void pnlFaculty_DoubleClick(object sender, EventArgs e)
        {
            TableAdministrationForm f = new TableAdministrationForm(databaseName, "Faculties");
            f.ShowDialog(this);
        }
      
    }
}
